package zkk.com.mengqu.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Adapter;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

import zkk.com.mengqu.R;
import zkk.com.mengqu.activity.CircleFriendArticleListActivity;

/**
 * Created by Administrator on 2017/4/5.
 * 饭友圈订阅设配器
 */
public class CircleFriendSubscribeAdapter extends BaseAdapter {
    private static final int TYPE_DATE = 0;//带日期
    private static final int TYPE_NOTDATE = 1;//不带日期

    private Context context;
    public CircleFriendSubscribeAdapter(Context con) {
        this.context=con;
    }

    @Override
    public int getCount() {
//        return paints==null?0:paints.size();
        return 10;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }



    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {

        MyPaintHolder myPaintHolder;
        if(convertView==null){
            myPaintHolder=new MyPaintHolder();
            convertView= LayoutInflater.from(context).inflate(R.layout.item_circle_friend_subscribe,null);
            convertView.setTag(myPaintHolder);
        }else {
            myPaintHolder = (MyPaintHolder) convertView.getTag();
        }

        convertView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                context.startActivity(new Intent(context , CircleFriendArticleListActivity.class));
            }
        });

        return convertView;
    }

    class MyPaintHolder{

        ImageView img_user;
        TextView comic_name,comic_title;
        ImageView img_icon,iv_like;
        Button like_btn;
    }
}
